package com.zyd.shiro.persistence.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.zyd.shiro.persistence.beans.WxappHelp;
import org.springframework.data.jpa.repository.Query;
import sun.awt.SunHints;

import java.util.List;

/**
 * 数据访问接口
 * @author Administrator
 *
 */
public interface MallWxappHelpDao extends JpaRepository<WxappHelp,Integer>,JpaSpecificationExecutor<WxappHelp>{



    @Query(value = "select * from mall_wxapp_help ORDER BY create_time ASC",nativeQuery = true)
    List<WxappHelp> findAllHelpASC();
    @Query(value = "select * from mall_wxapp_help ORDER BY create_time DESC",nativeQuery = true)
    List<WxappHelp> findAllHelpDESC();

    @Query(value = "select * from mall_wxapp_help bean where bean.title like CONCAT('%',?1,'%') order by create_time ASC",nativeQuery = true)
    List<WxappHelp> findAllByTitleASC(String title);
    @Query(value = "select * from mall_wxapp_help bean where bean.title like CONCAT('%',?1,'%') order by create_time DESC",nativeQuery = true)
    List<WxappHelp> findAllByTitleDESC(String title);

}
